package com.newcapec.service.impl;

import com.newcapec.bean.NewsEntity;
import com.newcapec.dao.NewsDao;
import com.newcapec.dao.impl.NewsDaoImpl;
import com.newcapec.service.NewsService;

import java.util.List;

/**
 * @Description:
 * @Author:yangshupeng
 * @Date: 2022/3/28 23:13
 * @Version:1.0
 */
public class NewsServiceImpl implements NewsService {
    NewsDao newsDao = new NewsDaoImpl();
    @Override
    public boolean addNews(NewsEntity newsEntity) {
        return newsDao.addNews(newsEntity);
    }

    @Override
    public boolean deleteNews(String id) {
        return newsDao.deleteNews(id);
    }

    @Override
    public boolean updateNews(NewsEntity newsEntity) {
        return newsDao.updateNews(newsEntity);
    }

    @Override
    public List<NewsEntity> query(int offset,int pageSize,NewsEntity news) {
        return newsDao.query(offset,pageSize,news);
    }

    @Override
    public NewsEntity queryById(String id) {
        return newsDao.queryById(id);
    }

    @Override
    public List<NewsEntity> queryByColumnId(int columnId) {
        return newsDao.queryByColumnId(columnId);
    }

    @Override
    public int getAllCount(String title) {
        return newsDao.getAllCount(title);
    }
}
